import com.sun.jndi.toolkit.url.Uri;

import java.util.ArrayList;
import java.util.List;

/**
 * 学生的管理类
 */
public class StudentHelper {
    ApiWrapper apiWrapper = new ApiWrapper();

    public static StudentHelper instance = new StudentHelper();

    public List<Student> students = new ArrayList<>();

    public StudentHelper(){
        students.add(new Student());
    }
    /**

     * 保存最棒的学生
     */
//    public AsyncJob<Boolean> saveTheBestStudent(String query) {
//        AsyncJob<List<Student>> queryJob = apiWrapper.queryStudents(query);
//        AsyncJob<Student> queryBestJob = queryJob.map(students -> findBestStudent(students));
//        AsyncJob<Boolean> saveJob = queryBestJob.flatmap(student -> apiWrapper.save(student));
//        return saveJob;
//    }

    /**
     * 查找最棒的学生
     */
    public Student findBestStudent(List<Student> students) {
        return students.get(0);// 此处逻辑可随意些，这里我随便写了一种
    }


}